<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" id="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />

    <link rel="stylesheet" href="http://cmp/css/cmp.css"/>
    <link rel="stylesheet" href="http://commons.v5.cmp/cmp-resources/M1H5.s3css"/>
    <link rel="stylesheet" href="http://commons.v5.cmp/cmp-resources/M1H5.s3css"/>
    <link rel="stylesheet" href="http://commons.v5.cmp/cmp-resources/M1H5.s3css"/>
<link rel="stylesheet" href="${data:dependencies.cmp}/css/cmp-att.css">
    <title>意见回复</title>
    <style>


    </style>
</head>
<body class="background_eee">

<header class="cmp-bar cmp-bar-nav M1_search_result_title">
    <a class="cmp-icon iconfont see-icon-error search_close "></a>
    <a href="#topPopover" class="cmp-icon cmp-see-see-icon-more cmp-pull-right"></a>
    <h1 class="cmp-title">意见回复</h1>
</header>
<div class="cmp-content position_relative">
    <div class="replay_opinion_content">
        <div class="information">
            <textarea id="textarea" rows="5" placeholder="请输入处理意见"></textarea>
            <div class="text_and_accessory">
                <h5 class="cmp-pull-left">124</h5>
                <span class="cmp-badge cmp-pull-right replay_badge cmp-ellipsis ">
                    <a href="#picture"  class="cmp-icon-synergy-list accessory1 linkObj"></a>
                </span>
            </div>
        </div>

    </div>

</div>


<div id="topPopover" class="cmp-popover cmp-popover-custom reply_to_papers_content">
    <div class="cmp-popover-arrow"></div>
    <div class="container">
        <ul class="reply_to_papers">
            <li class="cell">加签</li>
            <li class="cell">当前会签</li>
            <li class="cell">知会</li>
            <li class="cell">意见隐藏<span class="tak">关</span></li>
            <li class="cell">追踪 <span class="tak cmp-active">开</span></li>
        </ul>
    </div>

</div>

<div id="picture" class="cmp-popover cmp-popover-action     " >
</div>

<footer class="cmp-bar cmp-bar-footer footer_custom footer_replay">
    <button type="button" class="cmp-btn cmp-btn-primary cmp-btn-block display_inline-block">发送</button>

</footer>



<s3:data name='cordova' />
<script src="http://cmp/js/cmp.js"></script>
    
<script src="${data:dependencies.cmp}/js/cmp-att.js"></script>
<script>
cmp.ready(function(){

    cmp.toggle();


    var opts = {
        showAuth:1,
        initData: null,  //初始附件数据
        initDocData:null, //初始关联文档数据
        callback: function (result) {
            console.log("选择的数据:" + cmp.toJSON(result));
        },
        delCallback: function (att) {
            console.log("要删除的对象：" + cmp.toJSON(att));
        }
    };
    cmp.att.initUpload('#picture', opts);




    var reply_to_papers_content=document.querySelector('.reply_to_papers_content');
    var tak=reply_to_papers_content.querySelectorAll('.tak');
    for(var i= 0,len=tak.length;i<len;i++){
        (function(_){
            tak[_].addEventListener('tap',function(){
              for(var j= 0,l=tak.length;j<l;j++){
                  tak[j].classList.remove('cmp-active');
              }
                this.classList.add('cmp-active');
                this.innerHTML=='关'?this.innerHTML='开':this.innerHTML='关';
            },false);
        })(i);
    }

//        点击取消按钮
    cmp('body').on('tap', '.cmp-popover-action button', function() {
        var a = this,parent;
        //根据点击按钮，反推当前是哪个actionsheet
        for (parent = a.parentNode; parent != document.body; parent = parent.parentNode) {
            if (parent.classList.contains('cmp-popover-action')) {
                break;
            }
        }
        //关闭actionsheet
        cmp('#' + parent.id).popover('toggle');
    });
});


(function(_){
    _.toggle=function(){
        var href_show=document.querySelectorAll('a');
        for(var i=0,len=href_show.length;i<len;i++){
            (function(index){
                href_show[index].addEventListener('click',function(){
                    var thisId=this.href.toString().split('#')[1];
                    var content= document.getElementById(thisId);
                    if(content==null)return;
                    content.classList.contains('display_none')
                    ?content.classList.remove('display_none')
                    :content.classList.add('display_none');
                })
            })(i);
        }
    }
})(cmp);

</script>
</body>
</html>
